//
//  TixianTableViewCell.m
//  DJS
//
//  Created by 浪尖渝力 on 2018/2/9.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "TixianTableViewCell.h"

@implementation TixianTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(CGFloat)creatView{
    self.backgroundColor=_LightGrey;
    
    NSNumber *order_time=[_dic objectForKey:@"cash_time"];
    
    UILabel *timeLabel=[UILabel new];
    [self addSubview:timeLabel];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.top.mas_equalTo(15);
    }];
    timeLabel.text=[ZQTools changeTimeCuo:@"HH:mm:ss YYYY-MM-dd" :[NSString stringWithFormat:@"%@",order_time]];
    timeLabel.textColor=ColorWithRGB(79, 79, 79);
    timeLabel.font=[UIFont systemFontOfSize:16];
    
    UIView *beiJingView=[UIView new];
    [self addSubview:beiJingView];
    [beiJingView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.right.mas_equalTo(-20);
        make.height.mas_equalTo(240);
        make.top.mas_equalTo(timeLabel.mas_bottom).mas_equalTo(5);
    }];
    beiJingView.layer.cornerRadius=5;
    beiJingView.backgroundColor=[UIColor whiteColor];
    
    UIView *topView=[UIView new];
    [beiJingView addSubview:topView];
    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.mas_equalTo(0);
        make.height.mas_equalTo(60);
    }];
    topView.backgroundColor=_backgroundColor;
    
    NSNumber *cash_type=[_dic objectForKey:@"cash_type"];
    
    UILabel *order_typeLabel=[UILabel new];
    [topView addSubview:order_typeLabel];
    [order_typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(0);
        make.left.mas_equalTo(15);
    }];
    order_typeLabel.textColor=[UIColor whiteColor];
    order_typeLabel.font=[UIFont systemFontOfSize:20];
    order_typeLabel.text=@"提现";
    
    UILabel *order_typeLabel2=[UILabel new];
    [topView addSubview:order_typeLabel2];
    [order_typeLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(0);
        make.right.mas_equalTo(-15);
    }];
    order_typeLabel2.textColor=[UIColor whiteColor];
    order_typeLabel2.font=[UIFont systemFontOfSize:20];
    if (cash_type.integerValue==0) {
         order_typeLabel2.text=@"未处理";
    }  if (cash_type.integerValue==1) {
        order_typeLabel2.text=@"已处理";
    }  if (cash_type.integerValue==2) {
        order_typeLabel2.text=@"已拒绝";
    }
   
    UILabel *zhiChu=[UILabel new];
    [beiJingView addSubview:zhiChu];
    [zhiChu mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.top.mas_equalTo(topView.mas_bottom).mas_equalTo(30);
    }];
    zhiChu.text=@"提现金额";
    zhiChu.textColor=ColorWithRGB(69, 69, 69);
    zhiChu.font=[UIFont systemFontOfSize:16];
    
    UILabel *moneyLabel=[UILabel new];
    [beiJingView addSubview:moneyLabel];
    [moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.top.mas_equalTo(zhiChu.mas_bottom).mas_equalTo(20);
    }];
    NSString *order_money=[_dic objectForKey:@"cash_money"];
    moneyLabel.text=[NSString stringWithFormat:@"%@元",order_money];
    moneyLabel.font=[UIFont systemFontOfSize:22];
    moneyLabel.textColor=ColorWithRGB(29, 29, 29);
    
    
    UIView *xianView=[UIView new];
    [beiJingView addSubview:xianView];
    [xianView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(0);
        make.top.mas_equalTo(moneyLabel.mas_bottom).mas_equalTo(25);
        make.height.mas_equalTo(1);
    }];
    xianView.backgroundColor=_LightGrey;
    
    UILabel *label=[UILabel new];
    [beiJingView addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.top.mas_equalTo(xianView.mas_bottom).mas_equalTo(25);
    }];
    
    NSString *cash_agency=[_dic objectForKey:@"cash_agency"];
     NSString *cash_account=[_dic objectForKey:@"cash_account"];
    label.text=[NSString stringWithFormat:@"%@:%@",cash_agency,cash_account];
    label.font=[UIFont systemFontOfSize:16];
    label.textColor=ColorWithRGB(59, 59, 59);
    return 300;
}

-(CGFloat)creatView2{
    self.backgroundColor=_LightGrey;
    
    NSNumber *order_time=[_dic objectForKey:@"cash_check_time"];
    
    UILabel *timeLabel=[UILabel new];
    [self addSubview:timeLabel];
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.top.mas_equalTo(15);
    }];
    timeLabel.text=[ZQTools changeTimeCuo:@"HH:mm:ss YYYY-MM-dd" :[NSString stringWithFormat:@"%@",order_time]];
    timeLabel.textColor=ColorWithRGB(79, 79, 79);
    timeLabel.font=[UIFont systemFontOfSize:16];
    
    UIView *beiJingView=[UIView new];
    [self addSubview:beiJingView];
    [beiJingView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.right.mas_equalTo(-20);
        make.height.mas_equalTo(240);
        make.top.mas_equalTo(timeLabel.mas_bottom).mas_equalTo(5);
    }];
    beiJingView.layer.cornerRadius=5;
    beiJingView.backgroundColor=[UIColor whiteColor];
    
    UIView *topView=[UIView new];
    [beiJingView addSubview:topView];
    [topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.mas_equalTo(0);
        make.height.mas_equalTo(60);
    }];
    topView.backgroundColor=_backgroundColor;
    
    
    UILabel *order_typeLabel=[UILabel new];
    [topView addSubview:order_typeLabel];
    [order_typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(0);
        make.left.mas_equalTo(15);
    }];
    order_typeLabel.textColor=[UIColor whiteColor];
    order_typeLabel.font=[UIFont systemFontOfSize:20];
    order_typeLabel.text=@"提现";
    
    UILabel *order_typeLabel2=[UILabel new];
    [topView addSubview:order_typeLabel2];
    [order_typeLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(0);
        make.right.mas_equalTo(-15);
    }];
    order_typeLabel2.textColor=[UIColor whiteColor];
    order_typeLabel2.font=[UIFont systemFontOfSize:20];
    order_typeLabel2.text=@"已拒绝";

    UILabel *zhiChu=[UILabel new];
    [beiJingView addSubview:zhiChu];
    [zhiChu mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.top.mas_equalTo(topView.mas_bottom).mas_equalTo(30);
    }];
    zhiChu.text=@"提现金额";
    zhiChu.textColor=ColorWithRGB(69, 69, 69);
    zhiChu.font=[UIFont systemFontOfSize:16];
    
    UILabel *moneyLabel=[UILabel new];
    [beiJingView addSubview:moneyLabel];
    [moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.top.mas_equalTo(zhiChu.mas_bottom).mas_equalTo(20);
    }];
    NSString *order_money=[_dic objectForKey:@"cash_money"];
    moneyLabel.text=[NSString stringWithFormat:@"%@元",order_money];
    moneyLabel.font=[UIFont systemFontOfSize:22];
    moneyLabel.textColor=ColorWithRGB(29, 29, 29);
    
    
    UIView *xianView=[UIView new];
    [beiJingView addSubview:xianView];
    [xianView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(0);
        make.top.mas_equalTo(moneyLabel.mas_bottom).mas_equalTo(25);
        make.height.mas_equalTo(1);
    }];
    xianView.backgroundColor=_LightGrey;
    
    UILabel *label=[UILabel new];
    [beiJingView addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.top.mas_equalTo(xianView.mas_bottom).mas_equalTo(25);
    }];
    
    NSString *cash_agency=[_dic objectForKey:@"cash_agency"];
    NSString *cash_account=[_dic objectForKey:@"cash_account"];
    label.text=[NSString stringWithFormat:@"%@:%@",cash_agency,cash_account];
    label.font=[UIFont systemFontOfSize:16];
    label.textColor=ColorWithRGB(59, 59, 59);
    
    UILabel *laleb2=[UILabel new];
    [beiJingView addSubview:laleb2];
    [laleb2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.top.mas_equalTo(label.mas_bottom).mas_equalTo(15);
    }];
    laleb2.numberOfLines=2;
    NSString *cash_remark=[_dic objectForKey:@"cash_remark"];
    laleb2.text=[NSString stringWithFormat:@"%@",cash_remark];
    laleb2.font=[UIFont systemFontOfSize:16];
    laleb2.textColor=_backgroundColor;
    
    
    return 360;
    
}
@end
